package com.project.yuepai.service;

import com.github.pagehelper.PageInfo;
import com.project.yuepai.dto.UserBaseDto;
import com.project.yuepai.dto.UserRoleDto;
import com.project.yuepai.model.User;

public interface UserBaseService {
    //增
    boolean createUser(String username, String phone, String pwd);
    //删
    boolean deleteUser(String userId);
    //改
    boolean updateUser();
    //查
    User searchUserById(String userId);
    User searchUserByName(String username);
    User searchUserByPhone(String phone);
    User searchUserByEmail(String email);

    boolean judgeUserName(String username);

    //用户根据邮箱设置新密码
    boolean updatePwdByEmail(String email, String newPwd);
    //用户根据手机号设置新密码
    boolean updatePwdByPhone(String phone, String newPwd);

    //检查用户
    public UserBaseDto checkuser(User user);

    PageInfo<UserRoleDto> getUserAllInfos(Integer page, Integer limit, Integer userRole, String nickName, String userPhone);

    int deleteUserAndRole(String userId,int userRole,int roleId);
}
